import request from '@/utils/request'

const PREFIX_API = '/message'



export const myMessageDetail = (current, size, params) => {
  return request({
    url: PREFIX_API + '/msgSendDetail/selectMsgByAccount',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  });
};

// -------------


// 分页
export const getPage = (data) => {
  return request({
    url: PREFIX_API + '/template/search',
    method: 'post',
    data
  })
}

// 获取通道App
export const getAppByChannelType = (data) => {
  return request({
    url: PREFIX_API + '/app/getAppByChannelType',
    method: 'post',
    data
  })
}


// 新增
export const saveTemplate = (data) => {
  return request({
    url: PREFIX_API + '/template/saveTemplate',
    method: 'post',
    data
  })
}

// 编辑
export const updateById = (data) => {
  return request({
    url: PREFIX_API + '/template/updateById',
    method: 'post',
    data
  })
}

// 删除
export const deleteByIds = (data) => {
  return request({
    url: PREFIX_API + '/template/deleteByIds',
    method: 'post',
    data
  })
}

// 根据id更改模板状态
export const updateStatusById = (data) => {
  return request({
    url: PREFIX_API + '/template/updateStatusById',
    method: 'post',
    data
  })
}

export const getByIds = (ids) => {
  return request({
    url: PREFIX_API + '/template/getByIds',
    method: 'post',
    params: {
      ids: ids
    }
  })
}

export const getById = (id) => {
  return request({
    url: PREFIX_API + '/template/getById',
    method: 'post',
    params: {
      id: id
    }
  })
}
